package com.lovo;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.web.client.RestTemplate;

@SpringBootTest(classes = com.lovo.BootMain.class)
public class HttpClient {
    @Autowired
    RestTemplate restTemplate;
     @Test
    public void httpC(){
      String str=
         restTemplate.getForEntity("https://www.baidu.com/",String.class).getBody();
         System.out.println(str);
    }
}
